package com.yanggeng.demo.beginnerguidedemo.activity;

import android.app.SearchManager;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;

import com.yanggeng.demo.beginnerguidedemo.R;
import com.yanggeng.demo.beginnerguidedemo.activity.BaseActivity;
import com.yanggeng.demo.beginnerguidedemo.utils.ToastUtil;

/**
 * Created by yanggeng on 2017/10/16.
 */

public class SearchActivity extends BaseActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_search_app);
        setTitle(true, "搜索页面");
        Intent intent = getIntent();
        if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
            String key = intent.getStringExtra(SearchManager.QUERY);
            ToastUtil.centerToast(this, "the query key is " + key);
        }
    }
}
